package com.zr.controller;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class YzmController extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException {
	// TODO Auto-generated method stub
	super.doGet(req, resp);
}
@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
	
	
	}
public static void main(String[] args) {
	BufferedImage bi = new BufferedImage(35, 50, BufferedImage.TYPE_INT_RGB);
	Graphics g = bi.getGraphics();
	g.setColor(Color.WHITE);
	g.setFont(new Font("宋体", Font.BOLD, 60));
	g.drawString("3", 0, 50);
	try {
		ImageIO.write(bi, "jpg", new File("D:/1.jpg"));
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
}
